<%= header %>
<%= boomerangScript %>
<base href="/pages/05-angular/115-no-url-change.html" />
<script src="../../vendor/angular/angular.js"></script>
<script src="../../vendor/angular-resource/angular-resource.js"></script>
<script src="../../vendor/angular-ui-router/release/angular-ui-router.js"></script>
<script>
window.angular_imgs = [3000];

window.angular_html5_mode = true;

window.angular_nav_routes = ["/nothing", "/widgets/1", "115-no-url-change.html"];
// the first spa soft route change won't cause a beacon so we need a timeout to force the next route to happen
window.angular_nav_route_timeout = 5000;

window.total_spa_navigations = 0;
window.total_spa_inits = 0;
window.total_spa_cancels = 0;
</script>
<script src="support/app-ui-router.js"></script>
<div ui-view></div>
<script src="115-no-url-change.js" type="text/javascript"></script>
<script>
BOOMR.subscribe("spa_navigation", function() {
	// 1 for the hard nav
	window.total_spa_navigations++;
});

BOOMR.subscribe("spa_init", function() {
	// we should receive 3 spa_init events
	// 1 for the hard nav
	// 1 for the /nothing route.
	//   Angular won't find it and quickly redirect back to the "otherwise" path.
	//   Boomerang will detect that a route change is in progress and ignore the redirect back.
	//   Boomerang will also detect that the url didn't change and no resources were fetched
	//   and will cancel the beacon.
	// 0 for redirect back to 115-no-url-change.html
	// 1 for /widgets/1
	// 1 for 115-no-url-change.html
	window.total_spa_inits++;
});

BOOMR.subscribe("spa_cancel", function() {
	// 1 for the /nothing route
	window.total_spa_cancels++;
});

BOOMR_test.init({
	testAfterOnBeacon: 3,
	Angular: {
		enabled: true
	},
	instrument_xhr: true,
	autorun: false
});

/*global angular*/
document.addEventListener("DOMContentLoaded", function() {
	angular.bootstrap(document, ["app"]);
});
</script>
<%= footer %>
